home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-filaux.ads < prev    next >
Text File  |  1996-01-30  |  4KB  |  112 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                     S Y S T E M . F I L E _ A U X                        --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.3 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This package contains interfaces to C routines used by the direct
  27. --  and sequential I/O implementations.
  28.  
  29. with Interfaces.C;
  30. with Interfaces.C.Strings;
  31.  
  32. package System.File_Aux is
  33.  
  34.    -------------
  35.    -- C types --
  36.    -------------
  37.  
  38.    subtype C_Int      is Interfaces.C.Int;
  39.    subtype C_Long_Int is Interfaces.C.Long;
  40.    subtype C_Size_T   is Interfaces.C.Size_T;
  41.    subtype C_Char_Ptr is Interfaces.C.Strings.Chars_Ptr;
  42.    type    C_File_Ptr is new System.Address;
  43.    type    C_Void_Ptr is new System.Address;
  44.  
  45.    -----------------
  46.    -- C functions --
  47.    -----------------
  48.  
  49.    function C_Fclose (Stream : C_File_Ptr) return C_Int;
  50.    pragma Import (C, C_Fclose, "fclose");
  51.  
  52.    function C_Feof (File : C_File_Ptr) return C_Int;
  53.    pragma Import (C, C_Feof, "feof");
  54.  
  55.    function C_Fflush (Stream : C_File_Ptr) return C_Int;
  56.    pragma Import (C, C_Fflush, "fflush");
  57.  
  58.    function C_Fopen
  59.      (Filename : C_Char_Ptr;
  60.       Mode     : C_Char_Ptr)
  61.       return     C_File_Ptr;
  62.    pragma Import (C, C_Fopen, "fopen");
  63.  
  64.    function C_Fread
  65.      (Ptr    : C_Void_Ptr;
  66.       Size   : C_Size_T;
  67.       Nmemb  : C_Size_T;
  68.       Stream : C_File_Ptr)
  69.       return   C_Size_T;
  70.    pragma Import (C, C_Fread, "fread");
  71.  
  72.    function C_Fseek
  73.      (Stream : C_File_Ptr;
  74.       Offset : C_Long_Int;
  75.       Whence : C_Int)
  76.       return   C_Int;
  77.    pragma Import (C, C_Fseek, "fseek");
  78.  
  79.    function C_Ftell (Stream : C_File_Ptr) return C_Long_Int;
  80.    pragma Import (C, C_Ftell, "ftell");
  81.  
  82.    function C_Fwrite
  83.      (Ptr    : C_Void_Ptr;
  84.       Size   : C_Size_T;
  85.       Nmemb  : C_Size_T;
  86.       Stream : C_File_Ptr)
  87.       return   C_Size_T;
  88.    pragma Import (C, C_Fwrite, "fwrite");
  89.  
  90.    function C_Mktemp (S : C_Char_Ptr) return C_Char_Ptr;
  91.    pragma Import (C, C_Mktemp, "mktemp");
  92.  
  93.    function C_Null return C_Void_Ptr;
  94.    pragma Import (C, C_Null, "null_function");
  95.  
  96.    function C_Remove (Filename : C_Char_Ptr) return C_Int;
  97.    pragma Import (C, C_Remove, "remove");
  98.  
  99.    function C_Seek_End return C_Int;
  100.    pragma Import (C, C_Seek_End, "seek_end_function");
  101.  
  102.    function C_Seek_Set return C_Int;
  103.    pragma Import (C, C_Seek_Set, "seek_set_function");
  104.  
  105.    function C_Tmpfile return C_File_Ptr;
  106.    pragma Import (C, C_Tmpfile, "tmpfile");
  107.  
  108.    function C_Tmpnam (S : C_Char_Ptr) return C_Char_Ptr;
  109.    pragma Import (C, C_Tmpnam, "tmpnam");
  110.  
  111. end System.File_Aux;
  112.